interface InterfaceObject {
    name: string
    age: number
    address: string
}
type TypePerson = keyof InterfaceObject // name,age,address

function getObjectProperty<O, K extends keyof O>(obj: O, key: K) {
    return obj[key]
}


const object: InterfaceObject = {
    name: "陶品奇",
    age: 22,
    address: "衡阳"
}
const names: string = getObjectProperty<InterfaceObject, "name">(object, "name")
console.log(names)